<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['系统配置','物料类型配置']" icon="fa fa-cog" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>物料类型配置</h2>
                </header>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn">
								<!-- <div class="selectDate top_module">
                                    <div class="input-daterange input-group s_selected_time_box s_hover_box">
                                        <input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1"  autocomplete="off" placeholder="选择开始时间"/>
                                        <span class="s_selected_time_spe">至</span>
                                        <input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2"  autocomplete="off" placeholder="选择结束时间"/>
                                        <div class="s_del_icon" (click)='del_date()'>x</div>
                                    </div>
                                </div> -->
                                <!-- <button type="button" class="btn btn-primary" (click)="tableSearch()">查询</button> -->
                                <button type="button" class="btn btn-primary" (click)="showAddLimitModal(materialTypeModal)">添加</button>
                            </div>
                            <div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="tableSearch()" class="search-input" placeholder="物料类型名称">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
								</span>
							</div>
                        </div>
                        <div class="table_scroll">
                            <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                <thead>
                                    <tr>
                                        <th>物料类型编码</th>
                                        <th>物料类型名称</th>
                                        <th>最后修改人</th>
                                        <th>最后修改时间</th>
                                        <th *ngIf="isShowDelete">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let row of tableData" [ngClass]='{selected: activeSelected === row.id }'>
                                        <td>{{row.materielType}}</td>
                                        <td>{{row.materielTypeName}}</td>
                                        <td>{{row.updateName}}</td>
                                        <td>{{row.updateTime}}</td>
                                        <!-- 这里也根据权限 -->
                                        <td *ngIf="isShowDelete">
                                            <button type="button" (click)="editRow(row,materialTypeModal)">编辑</button>
                                            <!-- <button type="button" (click)="del_domCode(row)">删除</button> -->
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-fix clearfix">
                            <paginator [totalRecords]="totalCounts" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                            </paginator>
                            <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>
</div>

<!-- 新增项目管理 -->
<section bsModal #materialTypeModal="bs-modal" class="modal fade addRenewal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width: 670px;">
            <div class="modal-header">
                <button type="button" class="close" (click)="closeMaterialTypeModal(materialTypeModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">{{formType=="add"?'新增':'编辑'}}配置</h4>
            </div>
            <div class="modal-body">
                <form id="materialType" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
                    <div class="row form-horizontal">
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">物料类型编码<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="materielType" autocomplete="off" type="text" [(ngModel)]='materialTypeObj.materielType' placeholder="填写物料类型编码" [disabled]='formType=="edit"'/>
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-3 no-padding-right">物料类型名称<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="materielTypeName" autocomplete="off" type="text" [(ngModel)]='materialTypeObj.materielTypeName'  placeholder="填写物料类型名称" />
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" (click)="closeMaterialTypeModal(materialTypeModal)">取消</button>
                <button type="button" class="btn btn-primary" (click)="submitModal(materialTypeModal)">提交</button>
            </div>
        </div>
    </div>
</section>
<!-- 新增项目管理 结束 -->